package com.hongxun.design.bean;

import com.hongxun.design.MyApp;
import com.hongxun.design.constant.Constant;
import com.hongxun.design.mytools.MString;

/**
 * Created by zerdoor_pc on 2016/5/24.
 */
public class Exploration {
    public String exploration_id;
    public String uuid = "";
    public String voltage_grade = "";
    public String exploration_type = "11";
    public String number;
    public String name;
    public String TypeName;
    public String codeset_id;
    public String before_exp;
    // public String before_uuid = "";
    public String pt_id;
    public String pt_type;
    public String point_type;
    public String pt_objectid;
    public String lng;
    public String lat;
    public String before_lng;
    public String before_lat;
    public String distance;
    public String corner;
    public String alt = "";
    public String schedule_id;
    public String location_way;
    public String user_name;
    public String create_time;
    public String id;
    public String jsonstring;
    public String explor_id;
    public String classify;
    public String exploration_person;
    public String flag = MString.add;
    // private  String json="";
    public int icon;
    public int apapterStates = 0;


    public void setBean(Exploration b) {
        clear();
        pt_type = Constant.TEZHENGPOINT;
        exploration_id = b.getExploration_id();
        uuid = b.getUuid();
        number = b.getNumber();
        name = b.getName();
        codeset_id = b.getCodeset_id();
        before_exp = b.getBefore_exp();
        pt_id = b.getPt_id();
        pt_type = b.getPt_type();
        pt_objectid = b.getPt_objectid();
        lng = b.getLng();
        lat = b.getLat();
        before_lng = b.getBefore_lng();
        before_lat = b.getBefore_lat();
        distance = b.getDistance();
        corner = b.getCorner();
        alt = b.getAlt();
        schedule_id = b.getSchedule_id();
        location_way = b.getLocation_way();
        user_name = b.getUser_name();
        create_time = b.getCreate_time();
        id = b.getId();
        jsonstring = b.getJsonstring();
        icon = b.getIcon();
        point_type = b.getPoint_type();
        exploration_type = b.getExploration_type();
        explor_id = b.getExplor_id();
        // before_uuid = b.getBefore_uuid();
        flag = b.getFlag();
        voltage_grade = b.getVoltage_grade();
        classify = b.getClassify();
        exploration_person = b.getExploration_person();
        //  json=b.getJson();
    }

    public void setPhotoPassagewayItemBean(PhotoPassagewayItemBean b, BeforeExpItemBean bean) {
        clearNotype();
        try {
            exploration_id = b.getExploration_id();
        } catch (Exception e) {
        }
        try {
            uuid = b.getExploration_uuid();
        } catch (Exception e) {
        }

        try {
            distance = b.getDistance();
        } catch (Exception e) {
        }
        try {

            pt_id = b.getPt_id();
        } catch (Exception e) {
        }
        try {
            pt_objectid = b.getPt_objectid();
        } catch (Exception e) {
        }

        try {

            before_exp = bean.getBefore_exp_id();
        } catch (Exception e) {
        }

//        try {
//            before_uuid = bean.getBefore_uuid();
//        } catch (Exception e) {
//        }

        try {
            before_lng = bean.getLng();
        } catch (Exception e) {
        }

        try {
            before_lat = bean.getLat();
        } catch (Exception e) {
        }
        try {
            if (MyApp.currProject.getCurrent_schedule().equals("11")) {
                classify = MString.code_one;
            } else {
                classify = MString.code_two;
            }
            exploration_person =MyApp.userInfo.getUser_id();
        } catch (Exception e) {
        }

    }


    public void setBeanToHas(Exploration b) {

        try {


            if (b.getExploration_id().length() > 0) exploration_id = b.getExploration_id();
            if (b.getNumber().length() > 0) number = b.getNumber();
            if (b.getName().length() > 0) name = b.getName();
            if (b.getCodeset_id().length() > 0) codeset_id = b.getCodeset_id();
            if (b.getBefore_exp().length() > 0) before_exp = b.getBefore_exp();
            if (b.getPt_id().length() > 0) pt_id = b.getPt_id();
            if (b.getPt_type().length() > 0) pt_type = b.getPt_type();
            if (b.getPt_objectid().length() > 0) pt_objectid = b.getPt_objectid();
            if (b.getLng().length() > 0) lng = b.getLng();
            if (b.getLat().length() > 0) lat = b.getLat();
            if (b.getBefore_lng().length() > 0) before_lng = b.getBefore_lng();
            if (b.getBefore_lat().length() > 0) before_lat = b.getBefore_lat();
            if (b.getDistance().length() > 0) distance = b.getDistance();
            if (b.getCorner().length() > 0) corner = b.getCorner();
            if (b.getAlt().length() > 0) alt = b.getAlt();
            if (b.getSchedule_id().length() > 0) schedule_id = b.getSchedule_id();
            if (b.getLocation_way().length() > 0) location_way = b.getLocation_way();
            if (b.getUser_name().length() > 0) user_name = b.getUser_name();
            if (b.getCreate_time().length() > 0) create_time = b.getCreate_time();
            if (b.getId().length() > 0) id = b.getId();
            if (b.getJsonstring().length() > 0) jsonstring = b.getJsonstring();
            if (b.getIcon() != 0) icon = b.getIcon();
            if (b.getPoint_type().length() > 0) point_type = b.getPoint_type();
            if (b.getUuid().length() >= 0) uuid = b.getUuid();
            if (b.getExploration_type().length() >= 0) exploration_type = b.getExploration_type();
            if (b.getFlag().length() >= 0) flag = b.getFlag();
            if (b.getExplor_id().length() >= 0) explor_id = b.getExplor_id();
            if (b.getVoltage_grade().length() >= 0) voltage_grade = b.getVoltage_grade();
            if (b.getClassify().length() >= 0) classify = b.getClassify();
            if (b.getExploration_person().length() >= 0) exploration_person = b.getExploration_person();
        } catch (Exception e) {
        }
        // if (b.getJson().length()>0) json=b.getJson();
    }

    public void clear() {
        exploration_id = "";
        uuid = "";
        number = "";
        name = "";
        codeset_id = "";
        before_exp = "";
        pt_id = "";
        pt_type = "";
        pt_objectid = "";
        lng = "";
        lat = "";
        before_lng = "";
        before_lat = "";
        distance = "";
        corner = "";
        alt = "";
        schedule_id = "11";
        user_name = "";
        id = "";
        jsonstring = "";
        point_type = "11";
        exploration_type = "11";
        icon = 0;
        explor_id = "";
        voltage_grade = "";
        classify = "";
        flag = MString.add;
        exploration_person="";
        // json="";
    }

    public void clearNotype() {
        exploration_id = "";
        uuid = "";
        number = "";
        name = "";
        codeset_id = "";
        before_exp = "";
        pt_id = "";
        pt_objectid = "";
        lng = "";
        lat = "";
        before_lng = "";
        before_lat = "";
        distance = "";
        corner = "";
        alt = "";
        schedule_id = "11";
        location_way = "";
        user_name = "";
        exploration_type = "11";
        id = "";
        jsonstring = "";
        point_type = "11";
        icon = 0;
        explor_id = "";
        voltage_grade = "";
        classify = "";
        flag = MString.add;
        exploration_person="";
        // json="";
    }

//    public String getJson() {
//        return json;
//    }
//
//    public void setJson(String json) {
//        this.json = json;
//    }


    public String getExploration_person() {
        return exploration_person;
    }

    public void setExploration_person(String exploration_person) {
        this.exploration_person = exploration_person;
    }

    public String getClassify() {
        return classify;
    }

    public void setClassify(String classify) {
        this.classify = classify;
    }

    public String getVoltage_grade() {
        return voltage_grade;
    }

    public void setVoltage_grade(String voltage_grade) {
        this.voltage_grade = voltage_grade;
    }

    public String getExplor_id() {
        return explor_id;
    }

    public void setExplor_id(String explor_id) {
        this.explor_id = explor_id;
    }

    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public String getExploration_id() {
        if (exploration_id == null) exploration_id = "";
        return exploration_id;
    }

    public void setExploration_id(String exploration_id) {
        this.exploration_id = exploration_id;
    }

    public String getNumber() {
        if (number == null) number = "";
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getName() {
        if (name == null) name = "";
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTypeName() {
        return TypeName;
    }

    public void setTypeName(String typeName) {
        TypeName = typeName;
    }

    public String getCodeset_id() {
        if (codeset_id == null) codeset_id = "";
        return codeset_id;
    }

    public void setCodeset_id(String codeset_id) {
        this.codeset_id = codeset_id;
    }

    public String getBefore_exp() {
        if (before_exp == null) before_exp = "";
        return before_exp;
    }

    public void setBefore_exp(String before_exp) {
        this.before_exp = before_exp;
    }


    public String getPt_id() {
        if (pt_id == null) pt_id = "";
        return pt_id;
    }

    public void setPt_id(String pt_id) {
        this.pt_id = pt_id;
    }

    //特征点与定位点
    public String getPt_type() {
        if (pt_type == null) pt_type = "";
        return pt_type;
    }

    public void setPt_type(String pt_type) {
        this.pt_type = pt_type;
    }


    //新建与拆旧
    public String getPoint_type() {
        if (point_type == null) point_type = "11";
        return point_type;
    }


    public void setPoint_type(String point_type) {
        this.point_type = point_type;
        this.exploration_type = point_type;
    }

    public String getPt_objectid() {
        if (pt_objectid == null) pt_objectid = "";
        return pt_objectid;
    }

    public void setPt_objectid(String pt_objectid) {
        this.pt_objectid = pt_objectid;
    }

    public String getLng() {
        if (lng == null || lng.length() == 0) lng = "";
        return lng;
    }

    public void setLng(String lng) {
        this.lng = lng;
    }

    public String getLat() {
        if (lat == null || lat.length() == 0) lat = "";
        return lat;
    }

    public double getLat_d() {
        if (lat == null || lat.length() == 0) return 0;

        return Double.parseDouble(lat);
    }

    public double getLng_d() {
        if (lng == null || lng.length() == 0) return 0;
        return Double.parseDouble(lng);
    }

    public void setLat(String lat) {
        this.lat = lat;
    }

    public String getBefore_lng() {
        if (before_lng == null) before_lng = "";
        return before_lng;
    }

    public void setBefore_lng(String before_lng) {
        this.before_lng = before_lng;
    }

    public String getBefore_lat() {
        if (before_lat == null) before_lat = "";
        return before_lat;
    }

    public void setBefore_lat(String before_lat) {
        this.before_lat = before_lat;
    }

    public String getDistance() {
        if (distance == null) distance = "";
        return distance;
    }

    public void setDistance(String distance) {
        this.distance = distance;
    }

    public String getCorner() {
        if (corner == null) corner = "";
        return corner;
    }

    public void setCorner(String corner) {
        this.corner = corner;
    }

    public String getAlt() {
        if (alt == null) alt = "";
        return alt;
    }

    public void setAlt(String alt) {
        this.alt = alt;
    }

    public String getSchedule_id() {
        if (schedule_id == null) schedule_id = "";
        return schedule_id;
    }

    public void setSchedule_id(String schedule_id) {
        this.schedule_id = schedule_id;
    }

    public String getLocation_way() {
        if (location_way == null) location_way = "";
        return location_way;
    }

    public void setLocation_way(String location_way) {
        this.location_way = location_way;
    }

    public String getUser_name() {
        if (user_name == null) user_name = "";
        return user_name;
    }

    public void setUser_name(String user_name) {
        this.user_name = user_name;
    }

    public String getCreate_time() {
        if (create_time == null) create_time = "";
        return create_time;
    }

    public void setCreate_time(String create_time) {
        this.create_time = create_time;
    }

    public String getId() {
        if (id == null) id = "";
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getJsonstring() {
        if (jsonstring == null) jsonstring = "";
        return jsonstring;
    }

    public void setJsonstring(String jsonstring) {
        this.jsonstring = jsonstring;
    }


    public int getIcon() {
        return icon;
    }

    public void setIcon(int icon) {
        this.icon = icon;
    }

    public int getApapterStates() {
        return apapterStates;
    }

    public void setApapterStates(int apapterStates) {
        this.apapterStates = apapterStates;
    }

    public String getExploration_type() {
        return exploration_type;
    }

    public void setExploration_type(String exploration_type) {
        this.exploration_type = exploration_type;
    }
}
